﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using JTicket.BLL;

namespace JTicket.UI
{
    public partial class JT_CardPaySelect : RoleBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                this.t1.Text = DateTime.Now.ToString("yyyy-MM-dd");
                this.t2.Text = DateTime.Now.ToString("yyyy-MM-dd");
                bind();
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            bind();

        }
        public string setSatet(string stat)
        {
            switch (stat)
            {
                case "0":
                    return "登记";

                case "CZ": return "充值";
                case "GS": return "挂失";
                case "GM":
                    return "修改密码";
                default:
                    return "";
            }
        }
        private void bind()
        {
            try
            {
                int pages=0;
                int page=0;
                int len=50;

                List<Model.L_KaLog> KaLog = DAL.L_KaLog.GetList(page, len, ref pages);
                this.dg1.DataSource = KaLog;
                this.dg1.DataBind();  
            }
            catch (Exception ee)
            {
                Response.Write(ee.Message.ToString()); 
            }
        }
        protected void dg1_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemIndex == -1) return;
            e.Item.Attributes.Add("bgcolor", "#EFFFDA");
            e.Item.Attributes.Add("style", "cursor:hand");
            e.Item.Attributes.Add("onMouseOver=this.style.backgroundColor", "#DBE3FA");
            e.Item.Attributes.Add("onMouseOut=this.style.backgroundColor", "#F6F6F6");
        }
    }
}